package com.example.theorygame.base;

import org.cocos2d.nodes.CCSprite;

public class BaseElement extends CCSprite {
    /**构造方法*/
    public BaseElement(String filePath){
        super(filePath);
    }
    /**死亡接口*/
    //死亡属性
    public DieListener dieListener;
    //死亡接口
    public interface DieListener{
        void die();
    }
    //设置死亡接口
    public void setDieListener(DieListener dieListener){
        this.dieListener = dieListener;
    }
    /**人物销毁*/
    public void destroy(){
        if(dieListener !=null){
            dieListener.die();
        }
        this.removeSelf();
    }
}
